#!/bin/bash

# 业务jar包存放的目录
business_jar_dir=/opt/etk


# 解压业务的jar包
jars=`ls $business_jar_dir| grep '\.jar$' |grep -v 'dp\.jar'`

rm -rf ./src && mkdir src
busilibpath=""
for j in $jars; do
        cp $business_jar_dir/$j ./src
        cd ./src && jar xvf $j && rm -rf $j && cd -
        busilibpath=$busilibpath":"$business_jar_dir"/"$j
done

# 连接classpath
libs=`ls lib`
classpath="./src:./conf"$busilibpath
for l in $libs; do
        classpath=$classpath":./lib/"$l
done

java -cp $classpath ticket.startup.Main
